/// 头像上传结果模型
/// 
/// 用于封装头像上传操作的结果信息
/// 包括成功状态、头像URL和错误信息等
class AvatarUploadResult {
  /// 是否成功
  final bool success;
  
  /// 头像URL
  final String? imgUrl;
  
  /// 错误信息
  final String? errorMessage;
  
  const AvatarUploadResult._({
    required this.success,
    this.imgUrl,
    this.errorMessage,
  });
  
  /// 创建成功结果
  factory AvatarUploadResult.success(String imgUrl) {
    return AvatarUploadResult._(success: true, imgUrl: imgUrl);
  }
  
  /// 创建失败结果
  factory AvatarUploadResult.failure(String errorMessage) {
    return AvatarUploadResult._(
      success: false,
      errorMessage: errorMessage,
    );
  }
  
  @override
  String toString() {
    return 'AvatarUploadResult(success: $success, imgUrl: $imgUrl, errorMessage: $errorMessage)';
  }
}
